import java.util.Scanner;
public class demo013 {
    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        int b=1;
        int sum=0;
        while(true) {

            System.out.println("请输入第"+(b)+"个学生的成绩");
            int c=scan.nextInt();
            sum=sum+c;
            System.out.println("请问是否继续输入Y/N");
            String q=scan.next();
            if(q.equals("Y")) {
                b++;
            }
            else {
                break;
            }

        }
        System.out.println("总成绩为"+sum);
        System.out.println("平均成绩为"+(sum/b));

    }
}
